from collections import deque

cnt = 0


def traditional_dfs(num, sums, index, t):
    global cnt
    if index == num + 1:
        if sums == t:
            cnt += 1
        return
    if sums > t:
        return
    for use in (0, 1):
        traditional_dfs(num, sums + use * index, index + 1, t)


def traditional_bfs(num, target):
    global cnt
    queue = deque()
    queue.append((0, 1))  # (current_sum, next_number_to_consider)
    count = 0

    while queue:
        current_sum, next_num = queue.popleft()
        if current_sum == target:
            cnt += 1
            continue
        if next_num > num:
            continue
        # Option 1: Do not include next_num
        queue.append((current_sum, next_num + 1))
        # Option 2: Include next_num
        new_sum = current_sum + next_num
        if new_sum <= target:
            queue.append((new_sum, next_num + 1))


def main():
    n = int(input())
    if (1 + n) * n // 2 & 1 == 1:
        print(0)
        return
    # traditional_dfs(n,0,1,(n+1)*n//4)
    traditional_bfs(n, (n + 1) * n // 4)

    print(cnt // 2)


main()
